<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;

class CreatePayConfigsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('pay_configs', function (Blueprint $table) {
            $table->id();
            $table->integer('store_id')->default(0)->comment('店铺id');
            $table->tinyInteger('type')->default(0)->comment('支付类型 微信支付1 易宝支付2');
            $table->integer('merchant_id')->default(0)->comment('商户id');
            $table->string('pay_secret')->default('')->comment('支付secret');
            $table->string('app_id')->default('')->comment('微信key');
            $table->string('app_secret')->default('')->comment('微信secret');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE `pay_configs` comment '店铺微信配置表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('pay_configs');
    }
}
